<template>
  <div class="menu-translate overflow-y-auto">
    <div class="title">
      <div class="w-1/2 text-center">{{ translateTitle('Dams.ApplicationInterface.语言类型') }}</div>
      <div class="w-1/2 text-center">{{ translateTitle('Dams.ApplicationInterface.翻译项') }}</div>
    </div>
    <div v-for="item in contentOptions" :key="item.numIndex" class="menu-translate flex">
      <div class="w-1/2 flex justify-center items-center">{{ item.LANGUAGE_DESC }}</div>
      <div class="w-1/2">
        <el-input v-model="item.TRANSLATION_CONTENT" clearable :disabled="item.LANGUAGE_CODE == 'zh_CN'" />
      </div>
    </div>
  </div>
</template>
<script>
  import { translateTitle } from '@/utils/i18n'
  export default {
    name: 'JsonList',
    props: {
      list: {
        type: Array,
        default: () => [],
      },
    },
    data() {
      return {
        contentOptions: [],
      }
    },
    watch: {
      list: {
        deep: true,
        handler(newval) {
          this.contentOptions = newval
        },
      },
    },
    created() {
      this.contentOptions = this.list
    },
    methods: {
      translateTitle,
    },
  }
</script>
<style lang="scss" scoped>
  .menu-translate {
    width: 100%;
    .title {
      font-weight: 600;
    }
    .title,
    .menu-translate-item {
      display: flex;
      // justify-content: space-around;
      padding: 5px 0;
      border-bottom: 1px solid #edeef2;
    }
  }
</style>
